home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 55
/
MINAMI55.ISO
/
Varios
/
Juegos
/
03 - Red_Ninja.swf
/
scripts
/
DefineSprite_27
/
frame_1
/
DoAction.as
Wrap
Text File
|
2004-10-04
|
884b
|
32 lines
man_h = getProperty("/map/p", _height) / "2";
man_w = getProperty("/map/p", _width) / "2";
wall_h = _height / "2";
wall_w = _width / "2";
man_x1 = getProperty("/map/p", _X) - man_w;
man_x2 = getProperty("/map/p", _X) + man_w;
man_y1 = getProperty("/map/p", _Y) - man_h;
man_y2 = getProperty("/map/p", _Y) + man_h;
wall_x1 = _X - wall_w;
wall_x2 = _X + wall_w;
wall_y1 = _Y - wall_h;
wall_y2 = _Y + wall_h;
if(wall_x1 < man_x2 + "8" and man_x1 < wall_x2 + "8" and wall_y1 < man_y2 and man_y1 < wall_y2)
{
if(man_x1 < wall_x1)
{
setProperty("/map/p", _X, wall_x1 - "20");
}
else if(wall_x2 < man_x2)
{
setProperty("/map/p", _X, wall_x2 + "20");
}
else if(man_y1 < wall_y1)
{
setProperty("/map/p", _Y, wall_y1 - "12");
}
else if(wall_y2 < man_y2)
{
setProperty("/map/p", _Y, wall_y2 + "12");
}
}